import React, { Component } from 'react'
import { Button, Flex } from 'react-vant'
export default class Mytaps extends Component {
    render() {
        let {data,dataIndex,setIndex}=this.props
        return (
            <div>
                <Flex gutter={16} wrap='wrap'>
                    {
                        data.map((item,index)=>{
                    return <Flex.Item span={8} key={index}><Button type={dataIndex==index?'primary':'default'} onClick={()=>{
                        setIndex(index)
                    }}>{item}</Button></Flex.Item>
                        })
                    }
                </Flex>
            </div>
        )
    }
}
